program main
    implicit none
    character(len=10) :: s='12345'
    integer,external :: mylen
!    interface 
!        function mylen(s)
!            character,pointer :: s(10)
!            integer mylen
!        end function
!    end interface
    write(*,*)'s:',s
    write(*,*)'s(3)',s(3:3)
    write(*,*)'r:',mylen(s)
end program

integer function mylen(s)
    implicit none
    character :: s(10)
    write(*,*)'In function:',s
    mylen=count(s=='1')
end function
